package buffer;

import java.io.*;
import java.util.HashMap;

/**
 * @description: ToDo
 * @author: marin
 * @time: 2020/7/6 10:38
 */
public class BufferTest {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new FileReader("wenben.txt"));
        HashMap<String,String> hashMap = new HashMap();
        BufferedWriter writer = new BufferedWriter(new FileWriter("newwenben.txt"));
        String line=null;
        int temp = 0;
        while ((line=br.readLine())!= null){
            String[] split = line.split("\\.");
            hashMap.put(split[0],split[1]);
        }
        for (String key:hashMap.keySet()){
            writer.write(key+":"+hashMap.get(key));
            writer.newLine();
        }
        br.close();
        writer.flush();
        writer.close();
    }
}
